import {defineStore} from "pinia";

export const usePlanStore = defineStore('plan', {
    state: () => ({
        plans: [],
        isLoading: false
    }),
    actions: {
        async fetchPlans() {
            this.isLoading = true
            try {
                const res = await axios.get('/api/plans')
                this.plans = res.data
            } finally {
                this.isLoading = false
            }
        }
    }
})
